package com.example.amtf_tmdrecycle;

import java.io.Serializable;

public class Todolistinfo implements Comparable<Todolistinfo>, Serializable {          //为了实现排序，必须继承此接口
    private String name;                        //项目名称
    private String time;                        //项目开始时间
    private String end_time;                    //项目截止时间
    private int progress=0;                     //项目进度
    private byte[] image;                       //图片字节数组

    public Todolistinfo(String name, String time, String time_end, byte[] image) {
        this.name = name;
        this.time = time;
        this.end_time=time_end;
        this.image=image;
    }

    public  Todolistinfo(String name,String time,String time_end,int progress, byte[] image){     //数据库恢复数据时用
        this.name = name;
        this.time = time;
        this.end_time=time_end;
        this.progress=progress;
        this.image=image;
    }
    public String getName() {
        return name;
    }

    public String getTime() {
        return time;
    }

    public  String getEnd_time(){
        return end_time;
    }

    public byte[] getImage() {
        return image;
    }

    public int getProgress(){return progress;}

    public void setProgress(int progress){this.progress=progress;}

    @Override
    public int compareTo(Todolistinfo o) {
        int i = this.getTime().compareTo(o.getTime());      //按照时间排序
        return i;
    }
}
